﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Quartz;
using Webshop20.AntiCorruptionLayers.Quartz.Services.Contracts;

namespace Webshop20.AntiCorruptionLayers.Quartz.Jobs
{
    public class ResurrectOrderProcessJob : IJob
    {
        private IOrderProcessResurrectionService resurrectionService;

        public ResurrectOrderProcessJob(IOrderProcessResurrectionService resurrectionService)
        {
            this.resurrectionService = resurrectionService;
        }

        #region IJob Members

        public void Execute(JobExecutionContext context)
        {
            int processId = (int)context.JobDetail.JobDataMap["ProcessID"];
            Type eventType = (Type)context.JobDetail.JobDataMap["FollowingEventType"];

            resurrectionService.ResurrectOrderProcess(processId, eventType);
        }

        #endregion
    }
}
